cargo.git
11 years agoauto merge of #470 : alexcrichton/cargo/cargo-new-git, r=brson
bors [Wed, 3 Sep 2014 21:01:00 +0000 (21:01 +0000)]
auto merge of #470 : alexcrichton/cargo/cargo-new-git, r=brson

This adds a command-line --no-git option to disable this behavior, as well as
adding a global config section for `git = false`. While I was at it I write some
documentation for the configuration format that cargo uses.

11 years agoTurn --git on by default for `cargo-new`.
Alex Crichton [Thu, 28 Aug 2014 20:22:36 +0000 (13:22 -0700)]
Turn --git on by default for `cargo-new`.

This adds a command-line --no-git option to disable this behavior, as well as
adding a global config section for `git = false`. While I was at it I write some
documentation for the configuration format that cargo uses.

11 years agoauto merge of #507 : alexcrichton/cargo/profiles, r=brson
bors [Wed, 3 Sep 2014 20:13:56 +0000 (20:13 +0000)]
auto merge of #507 : alexcrichton/cargo/profiles, r=brson

For documentation, see the included documentation in the commit.

11 years agoRe-enable passing -g to rustc
Alex Crichton [Wed, 3 Sep 2014 18:54:47 +0000 (11:54 -0700)]
Re-enable passing -g to rustc

Now that there is a way to disable debuginfo for a build, we can go back to
passing it by default. Any bugs in debuginfo will get weeded out by specifying
`debug = false` in the profile.

11 years agoImplement manifest profiles
Alex Crichton [Wed, 3 Sep 2014 18:34:26 +0000 (11:34 -0700)]
Implement manifest profiles

For documentation, see the included documentation in the commit.

11 years agoauto merge of #506 : alexcrichton/cargo/sooner-lockfile, r=wycats
bors [Wed, 3 Sep 2014 15:28:57 +0000 (15:28 +0000)]
auto merge of #506 : alexcrichton/cargo/sooner-lockfile, r=wycats

It's quite annoying if you update a dependency, but it takes you awhile to get
the dependency building. Previously the dependency graph would have to be
updated each time because the lockfile was only written *after* a successful
build.

Other tools like `cargo generate-lockfile` will already generate a lockfile at
any time, so just make it easier by moving it up in the compilation process.

11 years agoGenerate a lockfile sooner in `cargo build`
Alex Crichton [Wed, 3 Sep 2014 15:23:59 +0000 (08:23 -0700)]
Generate a lockfile sooner in `cargo build`

It's quite annoying if you update a dependency, but it takes you awhile to get
the dependency building. Previously the dependency graph would have to be
updated each time because the lockfile was only written *after* a successful
build.

Other tools like `cargo generate-lockfile` will already generate a lockfile at
any time, so just make it easier by moving it up in the compilation process.

11 years agoauto merge of #501 : alexcrichton/cargo/issue-480, r=brson
bors [Wed, 3 Sep 2014 05:22:14 +0000 (05:22 +0000)]
auto merge of #501 : alexcrichton/cargo/issue-480, r=brson

If a repository is corrupt, blow it away entirely and start from scratch instead
of returning an error.

Closes #480

11 years agoauto merge of #500 : alexcrichton/cargo/fix-flaky-test, r=brson
bors [Wed, 3 Sep 2014 04:38:30 +0000 (04:38 +0000)]
auto merge of #500 : alexcrichton/cargo/fix-flaky-test, r=brson

This test has been flaky on the bots for quite some time now, and the cause has
now been discovered. The root cause of the failure is that the execve for the
`cargo --list` command was failing with ETXTBUSY. In querying the manpage, this
means:

    Executable was open for writing by one or more processes.

This error can be explained by the following trace:

1. Thread A, running the `cargo --list` test, opens the destination executable
   for writing because it's copying the current executable into a different
   location.
2. Thread B, some other test, forks the process. The file descriptor of the
   destination executable of thread A is now duplicated in this process.
3. Thread A closes all files and such, and then goes to fork/exec
   `cargo --list`.
4. Thread B has not had time to close all its descriptors. so it still has the
   executable open for writing, causing the `execve` of thread A to fail.

This commit just removes these tested portions of the test, only testing that
cargo probes PATH.

11 years agoauto merge of #499 : alexcrichton/cargo/issue-486, r=brson
bors [Wed, 3 Sep 2014 04:03:09 +0000 (04:03 +0000)]
auto merge of #499 : alexcrichton/cargo/issue-486, r=brson

They're not really related to benchmarks!

Closes #486

11 years agoauto merge of #495 : alexcrichton/cargo/issue-492, r=brson
bors [Wed, 3 Sep 2014 03:49:07 +0000 (03:49 +0000)]
auto merge of #495 : alexcrichton/cargo/issue-492, r=brson

Closes #492

11 years agoauto merge of #475 : alexcrichton/cargo/issue-458, r=brson
bors [Wed, 3 Sep 2014 02:48:05 +0000 (02:48 +0000)]
auto merge of #475 : alexcrichton/cargo/issue-458, r=brson

Relative paths are now considered relative to the directory containing the
`.cargo/config` file specifying the relative path.

I also merge ConfigValueValue into ConfigValue by moving the Path directly next
to the String that defined it so we can track which strings came from which
paths.

Closes #458

11 years agoauto merge of #491 : alexcrichton/cargo/issue-481, r=brson
bors [Wed, 3 Sep 2014 02:29:02 +0000 (02:29 +0000)]
auto merge of #491 : alexcrichton/cargo/issue-481, r=brson

The return value of `err.output()` will be `None` if the rustdoc executable
failed to spawn, in which case we can give a more graceful error message.

Closes #481

11 years agoauto merge of #471 : alexcrichton/cargo/issue-449, r=brson
bors [Wed, 3 Sep 2014 01:30:36 +0000 (01:30 +0000)]
auto merge of #471 : alexcrichton/cargo/issue-449, r=brson

This is often useful for picking up things like headers files from `*-sys`
packages when they had to compile locally (or perhaps for pkg-config).

Closes #449

11 years agoauto merge of #469 : alexcrichton/cargo/issue-442, r=brson
bors [Wed, 3 Sep 2014 00:40:07 +0000 (00:40 +0000)]
auto merge of #469 : alexcrichton/cargo/issue-442, r=brson

Discovering the prefix/suffix needs to understand that it's not actually
available.

Closes #442

11 years agoPass native output directories of dependencies
Alex Crichton [Thu, 28 Aug 2014 20:47:25 +0000 (13:47 -0700)]
Pass native output directories of dependencies

This is often useful for picking up things like headers files from `*-sys`
packages when they had to compile locally (or perhaps for pkg-config).

Closes #449

11 years agoFix relative override paths
Alex Crichton [Fri, 29 Aug 2014 04:38:35 +0000 (21:38 -0700)]
Fix relative override paths

Relative paths are now considered relative to the directory containing the
`.cargo/config` file specifying the relative path.

I also merge ConfigValueValue into ConfigValue by moving the Path directly next
to the String that defined it so we can track which strings came from which
paths.

Closes #458

11 years agoDon't fail!() when rustdoc fails to run
Alex Crichton [Sun, 31 Aug 2014 06:19:38 +0000 (23:19 -0700)]
Don't fail!() when rustdoc fails to run

The return value of `err.output()` will be `None` if the rustdoc executable
failed to spawn, in which case we can give a more graceful error message.

Closes #481

11 years agoauto merge of #468 : alexcrichton/cargo/issue-404, r=brson
bors [Tue, 2 Sep 2014 23:29:07 +0000 (23:29 +0000)]
auto merge of #468 : alexcrichton/cargo/issue-404, r=brson

Whenever possible, try to print a short path by using path_relative_from.

Closes #404

11 years agoauto merge of #502 : alexcrichton/cargo/try-to-fix-travis, r=alexcrichton
bors [Tue, 2 Sep 2014 22:44:09 +0000 (22:44 +0000)]
auto merge of #502 : alexcrichton/cargo/try-to-fix-travis, r=alexcrichton

11 years agoFix the 32-bit linux travis bots
Alex Crichton [Tue, 2 Sep 2014 18:51:39 +0000 (11:51 -0700)]
Fix the 32-bit linux travis bots

11 years agoSlim down the `cargo --list` test
Alex Crichton [Tue, 2 Sep 2014 16:51:48 +0000 (09:51 -0700)]
Slim down the `cargo --list` test

This test has been flaky on the bots for quite some time now, and the cause has
now been discovered. The root cause of the failure is that the execve for the
`cargo --list` command was failing with ETXTBUSY. In querying the manpage, this
means:

    Executable was open for writing by one or more processes.

This error can be explained by the following trace:

1. Thread A, running the `cargo --list` test, opens the destination executable
   for writing because it's copying the current executable into a different
   location.
2. Thread B, some other test, forks the process. The file descriptor of the
   destination executable of thread A is now duplicated in this process.
3. Thread A closes all files and such, and then goes to fork/exec
   `cargo --list`.
4. Thread B has not had time to close all its descriptors. so it still has the
   executable open for writing, causing the `execve` of thread A to fail.

This commit just removes these tested portions of the test, only testing that
cargo probes PATH.

11 years agoDon't run doc tests for `cargo bench`
Alex Crichton [Tue, 2 Sep 2014 16:01:17 +0000 (09:01 -0700)]
Don't run doc tests for `cargo bench`

They're not really related to benchmarks!

Closes #486

11 years agoUpdate docopt to fix -- option parsing
Alex Crichton [Sun, 31 Aug 2014 20:22:09 +0000 (13:22 -0700)]
Update docopt to fix -- option parsing

Closes #492

11 years agoSupport cross compiling to triples without dylibs
Alex Crichton [Thu, 28 Aug 2014 19:46:04 +0000 (12:46 -0700)]
Support cross compiling to triples without dylibs

Discovering the prefix/suffix needs to understand that it's not actually
available.

Closes #442

11 years agoPrint longer paths to Cargo.toml on failure
Alex Crichton [Thu, 28 Aug 2014 19:28:23 +0000 (12:28 -0700)]
Print longer paths to Cargo.toml on failure

Whenever possible, try to print a short path by using path_relative_from.

Closes #404

11 years agoBlow away corrupt database repos
Alex Crichton [Mon, 1 Sep 2014 06:15:11 +0000 (23:15 -0700)]
Blow away corrupt database repos

If a repository is corrupt, blow it away entirely and start from scratch instead
of returning an error.

11 years agoDon't use bundled fonts
Alex Crichton [Tue, 2 Sep 2014 17:30:20 +0000 (10:30 -0700)]
Don't use bundled fonts

11 years agoauto merge of #487 : Insanity133/cargo/patch-2, r=alexcrichton
bors [Sat, 30 Aug 2014 02:44:07 +0000 (02:44 +0000)]
auto merge of #487 : Insanity133/cargo/patch-2, r=alexcrichton

This is a fixed version of PR #478 on the gh-pages branch.

11 years agoFix a minor typo
Severen Redwood [Sat, 30 Aug 2014 02:07:25 +0000 (14:07 +1200)]
Fix a minor typo

11 years agoauto merge of #485 : alexcrichton/cargo/fix-for-rustc-master, r=alexcrichton
bors [Fri, 29 Aug 2014 19:04:34 +0000 (19:04 +0000)]
auto merge of #485 : alexcrichton/cargo/fix-for-rustc-master, r=alexcrichton

Extending #479 to use a `'static` shell instead of a `'a` shell.

11 years agoUpdate git2
Alex Crichton [Fri, 29 Aug 2014 19:02:28 +0000 (12:02 -0700)]
Update git2

This updates git2-rs to not use pkg-config on windows.

Closes #472

11 years agoBe compatible with the stdlib for now ('static shell)
Alex Crichton [Fri, 29 Aug 2014 19:00:15 +0000 (12:00 -0700)]
Be compatible with the stdlib for now ('static shell)

11 years agoRefresh Cargo.lock
Brian Koropoff [Fri, 29 Aug 2014 15:25:57 +0000 (08:25 -0700)]
Refresh Cargo.lock

This brings in versions of upstream components with build break fixes

11 years agoFix build breakage due to generalized type parameter and object bounds
Brian Koropoff [Fri, 29 Aug 2014 06:36:28 +0000 (23:36 -0700)]
Fix build breakage due to generalized type parameter and object bounds

It is worth noting that cargo was actually creating trait boxes
that contain non-static references, so I couldn't just put 'static
everywhere to appease rustc.

11 years agoFix deprecated method/function warnings with rustc master
Brian Koropoff [Fri, 29 Aug 2014 06:35:47 +0000 (23:35 -0700)]
Fix deprecated method/function warnings with rustc master

11 years agoauto merge of #416 : alexcrichton/cargo/dox, r=wycats
bors [Thu, 28 Aug 2014 19:32:37 +0000 (19:32 +0000)]
auto merge of #416 : alexcrichton/cargo/dox, r=wycats

Closes #414

11 years agoauto merge of #465 : alexcrichton/cargo/update-git2, r=wycats
bors [Thu, 28 Aug 2014 18:28:57 +0000 (18:28 +0000)]
auto merge of #465 : alexcrichton/cargo/update-git2, r=wycats

It turned out most of the methods in libgit2 don't actually require a Signature
structure, they're all mostly optional. This commit updates to this version of
libgit2 where the arguments are all optional.

Closes #463

11 years agoUpdate the git2 dependency
Alex Crichton [Thu, 28 Aug 2014 18:10:10 +0000 (11:10 -0700)]
Update the git2 dependency

It turned out most of the methods in libgit2 don't actually require a Signature
structure, they're all mostly optional. This commit updates to this version of
libgit2 where the arguments are all optional.

11 years agoauto merge of #459 : alexcrichton/cargo/update-git, r=wycats
bors [Thu, 28 Aug 2014 15:05:29 +0000 (15:05 +0000)]
auto merge of #459 : alexcrichton/cargo/update-git, r=wycats

An explanation can be found in the commit I made to git2-rs [1]. This is the
first step towards dealing with #457.

[1]: https://github.com/alexcrichton/git2-rs/commit/16142ef9

11 years agoLink to openssl statically for nightlies
Alex Crichton [Thu, 28 Aug 2014 04:26:34 +0000 (21:26 -0700)]
Link to openssl statically for nightlies

An explanation can be found in the commit I made to git2-rs [1]. This is the
first step towards dealing with #457.

[1]: https://github.com/alexcrichton/git2-rs/commit/16142ef9

11 years agoauto merge of #453 : dotdash/cargo/glob, r=alexcrichton
bors [Wed, 27 Aug 2014 15:18:20 +0000 (15:18 +0000)]
auto merge of #453 : dotdash/cargo/glob, r=alexcrichton

The glob crate that comes with rust itself has been deprecated.

11 years agoauto merge of #455 : alexcrichton/cargo/cargo-run, r=alexcrichton
bors [Wed, 27 Aug 2014 15:11:08 +0000 (15:11 +0000)]
auto merge of #455 : alexcrichton/cargo/cargo-run, r=alexcrichton

Just some minor test fixes.

11 years agoFix cargo-run rebasings and tests
Alex Crichton [Wed, 27 Aug 2014 15:01:26 +0000 (08:01 -0700)]
Fix cargo-run rebasings and tests

Closes #443

11 years agoMerge remote-tracking branch 'cmr/master'
Alex Crichton [Wed, 27 Aug 2014 15:04:38 +0000 (08:04 -0700)]
Merge remote-tracking branch 'cmr/master'

Conflicts:
src/cargo/ops/cargo_run.rs
tests/test_cargo_run.rs

11 years agoFix building with current rust by using rust-lang/glob
Björn Steinbrink [Wed, 27 Aug 2014 10:49:11 +0000 (12:49 +0200)]
Fix building with current rust by using rust-lang/glob

The glob crate that comes with rust itself has been deprecated.

11 years agoauto merge of #452 : alexcrichton/cargo/fix-nightly-linux, r=alexcrichton
bors [Wed, 27 Aug 2014 06:29:02 +0000 (06:29 +0000)]
auto merge of #452 : alexcrichton/cargo/fix-nightly-linux, r=alexcrichton

The linux nightly failed and hopefully this will fix it.

11 years agoBump the git2 dep
Alex Crichton [Wed, 27 Aug 2014 05:50:10 +0000 (22:50 -0700)]
Bump the git2 dep

The linux nightly failed and hopefully this will fix it.

11 years agoauto merge of #446 : alexcrichton/cargo/libgit2-again, r=brson
bors [Wed, 27 Aug 2014 05:38:17 +0000 (05:38 +0000)]
auto merge of #446 : alexcrichton/cargo/libgit2-again, r=brson

I applied https://github.com/libgit2/libgit2/pull/2414 to a [local branch](https://github.com/alexcrichton/libgit2/tree/mingw-w64-winhttp) and then fixed the build for mingw-w64. The tests pass fine on mingw and I've used https successfully on windows with libgit2 on cargo now.

11 years agoRoll back git2 a bit to fix tests
Alex Crichton [Wed, 27 Aug 2014 05:23:01 +0000 (22:23 -0700)]
Roll back git2 a bit to fix tests

11 years agoUpdate git2-rs with mingw support
Alex Crichton [Tue, 26 Aug 2014 18:31:28 +0000 (11:31 -0700)]
Update git2-rs with mingw support

An upstream PR for libgit2 was applied locally, modified to build, and then
git2-rs was updated to use this small for of libgit2. This adds https support
via winhttp on mingw for windows users.

11 years agoRevert "Revert "Use libgit2 for driving git instead of the CLI""
Alex Crichton [Tue, 26 Aug 2014 17:36:11 +0000 (10:36 -0700)]
Revert "Revert "Use libgit2 for driving git instead of the CLI""

This reverts commit 04440bb035082d4163f2211af447b8d67e077ccb.

Conflicts:
src/cargo/sources/git/utils.rs

11 years agoauto merge of #444 : alexcrichton/cargo/issue-54, r=brson
bors [Wed, 27 Aug 2014 02:51:45 +0000 (02:51 +0000)]
auto merge of #444 : alexcrichton/cargo/issue-54, r=brson

This generates errors for malformed semver versions during the decoding process
rather than later in the convertion to a package id. This also cuts down on the
large number of derived traits to only what's necessary.

Closes #54

11 years agoDisable travis on all branches but master
Alex Crichton [Wed, 27 Aug 2014 02:49:57 +0000 (19:49 -0700)]
Disable travis on all branches but master

11 years agoauto merge of #441 : EduardoBautista/cargo/fix-inconsistencies, r=alexcrichton
bors [Wed, 27 Aug 2014 02:36:21 +0000 (02:36 +0000)]
auto merge of #441 : EduardoBautista/cargo/fix-inconsistencies, r=alexcrichton

The guide appeared to be inconsistent with its use of "0.1.0" and "0.0.1" so I decided to change all version numbers to "0.0.1".

11 years agoauto merge of #423 : alexcrichton/cargo/cargo-package, r=brson
bors [Wed, 27 Aug 2014 02:17:17 +0000 (02:17 +0000)]
auto merge of #423 : alexcrichton/cargo/cargo-package, r=brson

This command will assemble the current package into a tarball ready for
uploading to the cargo registry. Currently no further verification is done
beyond packaging the local repository into a tarball, but in the future this
could execute other operations such as api stability tools.

11 years agoImplement cargo-package
Alex Crichton [Fri, 18 Jul 2014 15:40:45 +0000 (08:40 -0700)]
Implement cargo-package

This command will assemble the current package into a tarball ready for
uploading to the cargo registry. Currently no further verification is done
beyond packaging the local repository into a tarball, but in the future this
could execute other operations such as api stability tools.

11 years agoauto merge of #435 : alexcrichton/cargo/issue-431, r=brson
bors [Wed, 27 Aug 2014 02:00:57 +0000 (02:00 +0000)]
auto merge of #435 : alexcrichton/cargo/issue-431, r=brson

This option is used to disable the --test flag to rustc for a test or benchmark
target in order to signal that the binary already knows how to run the testing
infrastructure.

The test/benchmark is still compiled and run as usual, and the exit code is
expected to reflect the result of the test/benchmark.

Closes #431

11 years agoHelp debug a flaky windows test
Alex Crichton [Wed, 27 Aug 2014 01:58:58 +0000 (18:58 -0700)]
Help debug a flaky windows test

11 years agoAdd a `harness` manifest option
Alex Crichton [Mon, 25 Aug 2014 12:54:47 +0000 (05:54 -0700)]
Add a `harness` manifest option

This option is used to disable the --test flag to rustc for a test or benchmark
target in order to signal that the binary already knows how to run the testing
infrastructure.

The test/benchmark is still compiled and run as usual, and the exit code is
expected to reflect the result of the test/benchmark.

Closes #431

11 years agoauto merge of #420 : alexcrichton/cargo/issue-393-2, r=brson
bors [Wed, 27 Aug 2014 01:40:01 +0000 (01:40 +0000)]
auto merge of #420 : alexcrichton/cargo/issue-393-2, r=brson

This commit removes all distributed executables except for `cargo`. All
builtin subcommands are implemented through library calls, and the fallback
methods are retained to maintain extensability through new subcommands.

Closes #393

11 years agoRemove all subcommand executables
Alex Crichton [Thu, 21 Aug 2014 16:24:34 +0000 (09:24 -0700)]
Remove all subcommand executables

This commit removes all distributed executables except for `cargo`. All
builtin subcommands are implemented through library calls, and the fallback
methods are retained to maintain extensability through new subcommands.

Closes #393

11 years agoauto merge of #421 : alexcrichton/cargo/issue-418, r=wycats
bors [Wed, 27 Aug 2014 01:13:22 +0000 (01:13 +0000)]
auto merge of #421 : alexcrichton/cargo/issue-418, r=wycats

11 years agoauto merge of #419 : alexcrichton/cargo/issue-406, r=brson
bors [Wed, 27 Aug 2014 01:04:59 +0000 (01:04 +0000)]
auto merge of #419 : alexcrichton/cargo/issue-406, r=brson

This allows tests to be built, but not run.

Closes #406

11 years agoFix `cargo run` for renamed bin targets
Alex Crichton [Fri, 22 Aug 2014 16:53:56 +0000 (09:53 -0700)]
Fix `cargo run` for renamed bin targets

11 years agoAdd a --no-run option to `cargo test`
Alex Crichton [Thu, 21 Aug 2014 21:09:27 +0000 (14:09 -0700)]
Add a --no-run option to `cargo test`

This allows tests to be built, but not run.

11 years agoauto merge of #450 : alexcrichton/cargo/fix-cargo, r=alexcrichton
bors [Wed, 27 Aug 2014 00:24:01 +0000 (00:24 +0000)]
auto merge of #450 : alexcrichton/cargo/fix-cargo, r=alexcrichton

11 years agoFix a flaky test while the compiler is changing
Alex Crichton [Wed, 27 Aug 2014 00:21:45 +0000 (17:21 -0700)]
Fix a flaky test while the compiler is changing

11 years agoPrint out the rustc version before each build
Alex Crichton [Wed, 27 Aug 2014 00:21:15 +0000 (17:21 -0700)]
Print out the rustc version before each build

11 years agoFix building with current rust
Björn Steinbrink [Tue, 26 Aug 2014 18:55:39 +0000 (20:55 +0200)]
Fix building with current rust

11 years agoDecode directly into a semver::Version
Alex Crichton [Tue, 26 Aug 2014 15:45:33 +0000 (08:45 -0700)]
Decode directly into a semver::Version

This generates errors for malformed semver versions during the decoding process
rather than later in the convertion to a package id. This also cuts down on the
large number of derived traits to only what's necessary.

Closes #54

11 years agoUse "0.0.1" instead of "0.1.0" for version numbers
Eduardo Bautista [Mon, 25 Aug 2014 22:21:16 +0000 (17:21 -0500)]
Use "0.0.1" instead of "0.1.0" for version numbers

11 years agocargo-run: support target and release the same as cargo-build
Corey Richardson [Mon, 25 Aug 2014 14:51:13 +0000 (10:51 -0400)]
cargo-run: support target and release the same as cargo-build

11 years agoauto merge of #434 : alexcrichton/cargo/issue-433, r=huonw
bors [Mon, 25 Aug 2014 13:44:11 +0000 (13:44 +0000)]
auto merge of #434 : alexcrichton/cargo/issue-433, r=huonw

All subprocesses will now be invoked with CARGO_MANIFEST_DIR pointing at the root of the
source directory that they are working on (compiling). This commit also
reorganizes the version environment variables to use the new infrastructure.

Closes #433

11 years agoAdd a new CARGO_MANIFEST_DIR environment variable
Alex Crichton [Mon, 25 Aug 2014 12:40:47 +0000 (05:40 -0700)]
Add a new CARGO_MANIFEST_DIR environment variable

All subprocesses will now be invoked with CARGO_MANIFEST_DIR pointing at the
root of the source directory that they are working on (compiling). This commit
also reorganizes the version environment variables to use the new
infrastructure.

Closes #433

11 years agoauto merge of #430 : aochagavia/cargo/mod, r=alexcrichton
bors [Sun, 24 Aug 2014 20:59:09 +0000 (20:59 +0000)]
auto merge of #430 : aochagavia/cargo/mod, r=alexcrichton

Example:

```
use std::fmt;
use std::fmt::Show;
```

becomes

```
use std::fmt::{mod, Show};
```

11 years agoUse `mod` where possible
Adolfo Ochagavía [Sat, 23 Aug 2014 19:06:04 +0000 (21:06 +0200)]
Use `mod` where possible

Example:

```
use std::fmt;
use std::fmt::Show;
```

becomes

```
use std::fmt::{mod, Show};
```

11 years agoauto merge of #428 : garrison/cargo/patch-3, r=alexcrichton
bors [Sat, 23 Aug 2014 18:29:10 +0000 (18:29 +0000)]
auto merge of #428 : garrison/cargo/patch-3, r=alexcrichton

travis-ci now supports "language: rust", which eliminates the need to call rustup.sh in .travis.yml. See http://www.reddit.com/r/rust/comments/2ecocp/travis_ci_supports_rust/ for details.

This is the same change as #425, but on the master branch in guide.md, not guide.html.

11 years agoUpdate guide.md to use "language: rust" in .travis.yml
Jim Garrison [Sat, 23 Aug 2014 18:18:03 +0000 (11:18 -0700)]
Update guide.md to use "language: rust" in .travis.yml

travis-ci now supports "language: rust", which eliminates the need to call rustup.sh in .travis.yml. See http://www.reddit.com/r/rust/comments/2ecocp/travis_ci_supports_rust/ for details.

11 years agoBeef up some various documentation
Alex Crichton [Thu, 21 Aug 2014 18:34:05 +0000 (11:34 -0700)]
Beef up some various documentation

11 years agoauto merge of #415 : alexcrichton/cargo/in-tree-docs, r=wycats
bors [Thu, 21 Aug 2014 17:20:50 +0000 (17:20 +0000)]
auto merge of #415 : alexcrichton/cargo/in-tree-docs, r=wycats

There's a bunch of travis config now to rebuild the website whenever something is merged into master.

11 years agoAdd all docs in-tree
Alex Crichton [Thu, 21 Aug 2014 16:54:53 +0000 (09:54 -0700)]
Add all docs in-tree

11 years agoauto merge of #410 : alexcrichton/cargo/fix-doctest-with-dep, r=wycats
bors [Wed, 20 Aug 2014 18:29:03 +0000 (18:29 +0000)]
auto merge of #410 : alexcrichton/cargo/fix-doctest-with-dep, r=wycats

The movement of tests to the main `target` directory forgot to update a spot
where rustdoc used a -L flag.

Closes #411

11 years agoauto merge of #412 : ScriptDevil/cargo/default-help, r=alexcrichton
bors [Wed, 20 Aug 2014 17:44:04 +0000 (17:44 +0000)]
auto merge of #412 : ScriptDevil/cargo/default-help, r=alexcrichton

Most modern command line utilities print usage/help when invoked without any arguments.

cargo (prior to this patch) defaults to saying "no such subcommand" when invoked without arguments.
> $ cargo
> No such subcommand

With this patch, it will instead print the help message
> $ cargo
> Rust's package manager
>
> Usage:
> ...

11 years agoPrint help message if cargo is invoked with no arguments
Ashok Gautham [Wed, 20 Aug 2014 17:04:39 +0000 (22:34 +0530)]
Print help message if cargo is invoked with no arguments

11 years agoFix doc tests for libs with deps
Alex Crichton [Tue, 19 Aug 2014 20:10:55 +0000 (13:10 -0700)]
Fix doc tests for libs with deps

The movement of tests to the main `target` directory forgot to update a spot
where rustdoc used a -L flag.

11 years agoauto merge of #409 : alexcrichton/cargo/snapshots, r=alexcrichton
bors [Tue, 19 Aug 2014 19:55:37 +0000 (19:55 +0000)]
auto merge of #409 : alexcrichton/cargo/snapshots, r=alexcrichton

11 years agoRegister new snapshots
Alex Crichton [Tue, 19 Aug 2014 19:52:41 +0000 (12:52 -0700)]
Register new snapshots

11 years agoauto merge of #408 : alexcrichton/cargo/fix-master, r=alexcrichton
bors [Tue, 19 Aug 2014 18:54:07 +0000 (18:54 +0000)]
auto merge of #408 : alexcrichton/cargo/fix-master, r=alexcrichton

11 years agoFix some flaky tests on the buildbots
Alex Crichton [Tue, 19 Aug 2014 18:51:02 +0000 (11:51 -0700)]
Fix some flaky tests on the buildbots

11 years agoauto merge of #390 : alexcrichton/cargo/revert-libgit2, r=wycats
bors [Tue, 19 Aug 2014 16:21:40 +0000 (16:21 +0000)]
auto merge of #390 : alexcrichton/cargo/revert-libgit2, r=wycats

It has been discovered that the windows builders aren't building a libgit2 with support for SSL, so cloning https repos on windows is broken with libgit2. It doesn't look easy to sort out, so in the meantime this PR reverts the switch to libgit2 and adds @wycats's fixes from the related PR.

11 years agoSyncs submodules after remote update (closes #370)
Tim Carey-Smith [Fri, 15 Aug 2014 22:12:14 +0000 (15:12 -0700)]
Syncs submodules after remote update (closes #370)

Previously, the Git code avoided cloning a local copy of the local
database for a repository if the repo already existed (and instead tried
to fetch). However, fetching does not sync and reinitialize submodules,
which would require more work.

To avoid this problem, and possibly other subtle updating issues in the
future, the code now wipes the local clone whenever it detects that the
HEAD of a particular branch has changed. This avoids subtle
inconsistencies between fresh clones and updates.

Note: This only affects local-to-local clones. It does not initiate any
new network activity. It may require some additional disk usage, but
only when a remote fetch that was already happening discovers new
commits on the checked-out branch.

11 years agoRevert "Use libgit2 for driving git instead of the CLI"
Alex Crichton [Sun, 17 Aug 2014 07:10:23 +0000 (00:10 -0700)]
Revert "Use libgit2 for driving git instead of the CLI"

This reverts commit 3cd82ed7a191c4adb954704e9396368863eccddf.

Conflicts:
src/cargo/sources/git/utils.rs

11 years agoauto merge of #384 : alexcrichton/cargo/issue-379, r=wycats
bors [Tue, 19 Aug 2014 06:49:09 +0000 (06:49 +0000)]
auto merge of #384 : alexcrichton/cargo/issue-379, r=wycats

Mainly targeted at incremental build times.

11 years agoMake a timing test a little less flaky
Alex Crichton [Tue, 19 Aug 2014 05:51:14 +0000 (22:51 -0700)]
Make a timing test a little less flaky

11 years agoAllow updating transitive deps
Alex Crichton [Sat, 16 Aug 2014 01:25:12 +0000 (18:25 -0700)]
Allow updating transitive deps

Previously `cargo update foo` would only update the package `foo` if it were a
direct dependency of the local package. This meant that to update a transitive
dependency you would have to update the top-level dependency.

This commit adds the ability to update any dependency by name, regardless of
where it is in the dependency graph. This commit is a bit lossy in terms of
behavior. We are guaranteed that the set of immediate dependencies for any one
package have unique names, but not for the entire package graph. This means that
when you invoke `cargo update foo` it could possibly update two packages named
`foo`.

I believe this behavior to be acceptable for now and we can add a more stringent
update syntax later (something like `cargo update --namespace foo bar`). I
believe we'll always want this CLI usage, however.

11 years agoPreserve $OUT_DIR across rebuilds
Alex Crichton [Sat, 16 Aug 2014 01:15:13 +0000 (18:15 -0700)]
Preserve $OUT_DIR across rebuilds

The original choice for completely destroying $OUT_DIR was to focus on
repeatable builds to ensure that stale items in $OUT_DIR don't affect later
compilations. This commit moves this responsibility from cargo to the build
command itself.

Build commands are now responsible for cleaning out old artifacts and ensuring
that when invoked the state of $OUT_DIR is as it would be if it started with an
empty $OUT_DIR. This will allow for very long build commands based on `make` to
have a much faster incremental build time as they won't have to rebuild
everything when updated.

This can cause non-repeatable builds with build commands if stale artifacts are
never removed (but still used in the rust compilation step), but this will now
be considered a bug in the build command rather than for cargo itself.

Closes #382

11 years agoAdd an exclude key to the manifest
Alex Crichton [Sat, 16 Aug 2014 00:57:16 +0000 (17:57 -0700)]
Add an exclude key to the manifest

This key is used to help determine the set of input files for a package. The
normal method (via walking or git ls-files) is filtered via all the patterns
provided in `exclude` of the project section.

The toml key is a string array corresponding to a set of glob patterns according
to the syntax of libglob (provided in the standard distribution). The set of
files normally found will be filtered by each pattern, and if any pattern
matches then the path is excluded.

This will later on be used for `cargo package` when generating a tarball to get
uploaded.

11 years agoFactor in .gitignore for build cmd freshness
Alex Crichton [Sat, 16 Aug 2014 00:40:08 +0000 (17:40 -0700)]
Factor in .gitignore for build cmd freshness

When testing the freshness of a build command, the fingerprint of an entire
package is generated. The current method of fingerprinting a path source is to
just stat() the entire tree and look at mtimes. This works fine when the build
command places *all* output in the build directory.

Some systems, like autotools, place *most* output in the build directory and
some output in the source directory, however (see spidermonkey). In this case
the coarse-grained "consider all files in a directory as input" is too painful
for the build command as the package will forever be rebuilt.

This commit adds support for filtering the list of files in a directory
considered to be part of a package by using `git ls-files`. This git-specific
logic can be extended to other VCSs when cargo grows support for them.

Closes #379

11 years agoauto merge of #401 : alexcrichton/cargo/issue-348, r=wycats
bors [Tue, 19 Aug 2014 06:32:54 +0000 (06:32 +0000)]
auto merge of #401 : alexcrichton/cargo/issue-348, r=wycats

This commit changes the hash of Profile to only take into account
flags/variables that affect the actual output file itself (as opposed to its
location), and then changes cargo {test, build, doc} to all use the same
directory of output (in order to share deps).

This will cause a `cargo build` to remove all of the tests generated by `cargo
test`, but it speeds up the cycle of `cargo test` followed by a `cargo build` by
not needing to rebuild all dependencies.

Additionally, `cargo bench` now shares the same directory as
`cargo build --release` for the same reasons as above.

Closes #348